
// https://github.com/gatieme/CodingInterviews

#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <cstring>
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <deque>
#include <stack>
#include <bitset>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <list>
#include <unordered_set>

#include <functional>
#include <climits>
#include <algorithm>
#include <iostream>  // std::cout
#include <algorithm> // std::sort
#include <vector>

using namespace std;

struct TreeNode
{
    int value;
    TreeNode *left;
    TreeNode *right;
    TreeNode(int x) : value(x), left(NULL), right(NULL) {}
};

struct ListNode
{
    int value;
    ListNode *next;
    //ListNode(int x) :value(x), next(NULL) {}
};

// 预先定义的数值，链表，二叉树等，
vector<int> a = {2, 0, 1, 5, 2, 4, 6};

// 003-二维数组中的查找
//在一个二维数组中，每一行都按照从左到右递增的顺序排序，每一列都按照从上到下递增的顺序排序。请完成一个函数，输入这样的一个二维数组和一个整数，
//判断数组中是否含有该整数。

int Bits(int n)
{
    int result = 0;
    while (n > 0)
    {
        if (n & 1 == 1)
        {
            result++;
        }
        n >>= 1;
    }
}

vector<int> BFS(TreeNode *root)
{
    queue<TreeNode *> tree_queue;
    if (root != nullptr)
    {
        tree_queue.push(root);
    }
    while (!tree_queue.empty())
    {
        TreeNode *current_node = tree_queue.front();
        tree_queue.pop();
        cout << "" << current_node->value;

        tree_queue.push(current_node->left);
        tree_queue.push(current_node->right);
    }
}

void traverse(TreeNode *root)
{
    while (root != nullptr)
    {
        traverse(root->left);

        traverse(root->right);
    }
}

bool cmp(int a, int b)
{
    string A, B;
    A += to_string(a);
    A += to_string(b);

    B += to_string(b);
    B += to_string(a);

    return (A < B);
}

string PrintMinNumString(vector<int> numbers)
{
    string res;
    sort(numbers.front(), numbers.back(), cmp);
    for (auto i : numbers)
    {
        res += to_string(i);
    }
}



int TreeDepthRecursion(TreeNode *root){
    while(root!=nullptr){
        int left_depth = TreeDepthRecursion(root->left);
        int right_depth = TreeDepthRecursion(root->right);
        return max(left_depth,right_depth)+1;    
    }


}


int main()
{

    return 0;
}
